import service from "./indexApi";
const employeeApi={
    //添加
    insert(employee){
        return service.post('/admin/employee',employee);
    },
    //修改
    update(employee){
        return service.put('/admin/employee',employee);
    },
    //删除
    delete(eid){
        return service.delete(`/admin/employee/${eid}`);
    },
    //根据eid查询
    selectByEid(eid){
        return service.get(`/admin/employee/${eid}`);
    },
    //查询所有
    selectAll(ename){
        return service.get('/admin/employee',{
            params: {
                ename
            }
          });
    },
    //获取所有在可选部门名称
    allDept(eid){
        return service.get(`/admin/employee/allDept/${eid}`);
    },
    //分配部门
    insertEidAndDid(eid,dids){
        return service.post('/admin/employee/eidAndDid',{
            eid,
            dids
        });
    }
}

export default employeeApi;